import axios from "@/http.ts";

const startPlaySong = (item, store) => {
  const { id, singer, name, picUrl, duration } = item;
  axios
    .get("/song/url", {
      params: {
        id,
      },
    })
    .then((res) => {
      store.changePlayInfo({
        isplay: true,
        playImg: picUrl,
        playSinger: singer,
        playSongName: name,
        totalTime: duration,
        currentTime: "0",
        playSrc: res.data.data[0].url,
      });
    });
};
export default startPlaySong;
